export const URL = {
  waterSupply: 'waterSupplySystem',
  gasSupply: 'airSupply',
  powerSupply: 'powerSupply',
  traffic: 'traffic',
  communication: 'communication'
}

export const TYPE = {
  waterSupply: 'waterSupply',
  gasSupply: 'gasSupply',
  powerSupply: 'powerSupply',
  traffic: 'traffic',
  communication: 'communication'
}

export const evaluationObject = [
  { name: '供水系统', value: '1' },
  { name: '供气系统', value: '2' },
  { name: '供电系统', value: '3' },
  { name: '交通系统', value: '4' },
  { name: '通信系统', value: '5' }
]

export const inputMethods = [
  { name: '烈度', value: 1 },
  { name: '地震影响场', value: 2 }
]

export const listSourceField = {
  waterSupply: '供水系统基础数据',
  gasSupply: '供气系统基础数据',
  powerSupply: '供电系统基础数据',
  traffic: '交通系统基础数据',
  communication: '通信系统基础数据'
}

export const sourceData = {
  waterSupply: {
    name: '供水系统数据源选择', checkboxData: [
      { name: '地下管网', value: 1 },
      { name: '水厂泵房', value: 11 },
      { name: '水厂水池', value: 2 }
    ]
  },
  gasSupply: {
    name: '供气系统数据源选择', checkboxData: [
      { name: '燃气-储气罐', value: 3 },
      { name: '燃气-门站/场站', value: 14 },
      { name: '供气管网', value: 15 }
    ]
  },
  powerSupply: {
    name: '供电系统数据源选择', checkboxData: [
      { name: '变电站', value: 6 },
      { name: '电缆线路', value: 8 },
      { name: '重要发电厂房', value: 12 }
    ]
  },
  traffic: {
    name: '交通系统数据源选择', checkboxData: [
      { name: '道路', value: 5 },
      { name: '桥梁', value: 4 }
    ]
  },
  communication: {
    name: '通信系统数据源选择', checkboxData: [
      { name: '通信基站', value: 13 },
      { name: '通信室内设备', value: 9 }
    ]
  }
}
// 变电站数据、基站数据
export const diffType = [6, 13]

export const getIntensity = (value) => {
  let intensity = ''
  switch (value) {
    case 'ld1':
      intensity = '6'
      break
    case 'ld2':
      intensity = '7'
      break
    case 'ld3':
      intensity = '8'
      break
    case 'ld4':
      intensity = '9'
      break
    case 'ld5':
      intensity = '10'
      break
    default:
      break;
  }
}

export const getFieldName = (type, value, prefix, next) => {
  let name = ''
  if (type == '1' && value) {
    name = `${prefix}${Number(value?.slice(2))+5}`
    next && (name = `${name}${next}`)
  } else if (type == '2') {
    name = `${prefix}${next}`
  }
  return name
}
